import re
import pymysql
import csv,codecs


class TutorialPipeline:

    def process_item(self, item, spider):
        data = [item['job'],
            item['where'],
            item['when'],
            item['who'],
            item['salary'],
            item['salaryType'],
            item['company'],
            item['industry']
                ]
        with open('./test.csv', 'a',encoding='gbk',newline='') as fp:
            writer = csv.writer(fp)  # 获取文件“写笔”
            writer.writerow(data)  # 写入一行记录

